/*
 *  user:38917
 *  date:2025/4/29
 *  time:14:06
 */

import java.util.Arrays;

public class Array_Blog {
    //
    public static void main1(String[] args) {
        int score1 = 60;
        int score2 = 61;
        int score3 = 62;
        int score4 = 63;
        int score5 = 64;
        System.out.println(score1);
        System.out.println(score2);
        System.out.println(score3);
        System.out.println(score4);
        System.out.println(score5);
    }
    //
    public static void main2(String[] args) {
        int[] array1 = new int[10];
        int[] array2 = new int[]{1,2,3,4,5,6,7,8,9,10};
        int[] array3 = {1,2,3,4,5,6,7,8,9,10};
    }
    //
    public static void main3(String[] args) {
        int[] array = new int[]{1,2,3,4,5};
        System.out.println(array[0]);
        System.out.println(array[1]);
        System.out.println(array[2]);
        System.out.println(array[3]);
        System.out.println(array[4]);
        System.out.println(array[5]);
    }
    //
    public static void main4(String[] args) {
        int[] array = new int[]{1,2,3,4,5,6,7,8,9,10};
        for (int i = 0; i < array.length; i++) {
            System.out.println(array[i]);
        }
        for (int i : array) {
            System.out.println(i);
        }
    }
    //
    public static void main5(String[] args) {
        int a = 100;
        int b = 200;
        int[] array = new int[]{1,2,3};
    }
    //
    public static void main6(String[] args) {
        int[] array = null;
        System.out.println(array[0]);
    }
    //
    public static void main7(String[] args) {
        int[] array = new int[]{1,2,3,4,5,6,7,8,9,10};
        String string = Arrays.toString(array);
        System.out.println(string);
    }

    public static void main8(String[] args) {
        int[] array = new int[]{1,3,2,4,7,6,5,8,9,10};
        Arrays.sort(array);
        for(int cur : array) {
            System.out.print(cur + " ");
        }
    }

    public static void main9(String[] args) {
        int[] array1 = new int[]{1,2,3,4,5,6,7,8,9,10};
        //将数组完整地拷贝一份
        int[] array2 = Arrays.copyOf(array1, array1.length);
        for(int cur : array2) {
            System.out.print(cur + " ");
        }
        System.out.println();
        System.out.println("========================================");
        //范围拷贝[1,9)左闭右开
        int[] array3 = Arrays.copyOfRange(array1, 1, 9);
        for(int cur : array3) {
            System.out.print(cur + " ");
        }
    }

    public static void main(String[] args) {
        int[][] array1 = {{1,2,3},{4,5,6},{7,8,9}};
        System.out.println(array1[0]);
        System.out.println(Arrays.toString(array1[0]));
        int[][] array2 = new int[2][];
        array2[0] = new int[]{1,2,3};
        array2[1] = new int[]{4,5,6,7,8,9,10};
    }
}